package com.example.servicewallet.exception;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author my
 * @date 2023/2/8
 * @apiNote
 * 定义自定义异常类
 */
@Data
@AllArgsConstructor  //生成有参数构造方法
@NoArgsConstructor   //生成无参数构造
public class MyException extends RuntimeException  {

    @ApiModelProperty(value = "状态码")
    private Integer code;//状态码
    private String msg;//异常信息


    @Override
    public String toString() {
        return "MyException{" +
                "message=" + this.getMessage() +
                ", code=" + code +
                '}';
    }
}
